﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class UserControls_Product : System.Web.UI.UserControl
{
    private DTOS.Products.ProductDTO _objProduct = null;

    protected void Page_Load(object sender, EventArgs e)
    {


    }

    public DTOS.Products.ProductDTO GetProductDetails
    {
        get
        {
            AssignProductDetails();
            return _objProduct;
        }

        set
        {
            _objProduct = value;
        }
    }

    private void  AssignProductDetails()
    {
        try
        {
            _objProduct = new DTOS.Products.ProductDTO();
            _objProduct.CategoryCode = ddlProdCategory.SelectedItem.Value;
            _objProduct.ProductCode = txtProductCode.Text.Trim();
            _objProduct.ProductName = txtProductName.Text.Trim();
            _objProduct.ProductDesc = txtProductDesc.Text.Trim();
            _objProduct.Petalu = Convert.ToInt32(ddlPetalu.SelectedItem.Value);
            _objProduct.Quantity = Convert.ToInt32(txtQuantity.Text.Trim());
            _objProduct.GrossWeight = Convert.ToDecimal(txtWeight.Text.Trim());
            _objProduct.Wastage = Convert.ToDecimal(txtWastage.Text.Trim());
            _objProduct.Size = Convert.ToDecimal(txtSize.Text.Trim());
            _objProduct.SizeUnit = ddlSizeUnit.SelectedItem.Value;
            _objProduct.MakingCharge = Convert.ToDecimal(txtMakingCharge.Text.Trim());
            _objProduct.OtherCharges = Convert.ToDecimal(txtOtherCharges.Text.Trim());
            _objProduct.IsKDM = chkIsKDM.Checked;
            _objProduct.IsStones = chkIsStones.Checked;
           
        }
        catch
        {
        }

    }



}